package com.icinfo.cloud.provider.punish.ucase.casemain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.ObjectUtils;

/**
 * 描述：附件类型枚举
 *
 * @author xiangyuyu
 * @date 2022/2/27 11:16
 */
@AllArgsConstructor
public enum AttachmentTypeEnum {
    /**
     * 附件类型枚举
     */
    EVIDENCE("EVIDENCE", "证据"),
    SENT_RECEIPT("SENT_RECEIPT", "送达回证"),
    SENT_EVIDENCE("SENT_EVIDENCE", "送达证据"),
    OFFLINE_SIGN_FILE("OFFLINE_SIGN_FILE", "线下已签署文书"),
    OTHER_EVIDENCE("OTHER_EVIDENCE", "其他证据"),
    //新增强制执行申请相关附件枚举
    USER_CARD("USER_CARD", "经营者或法人身份证件"),
    BUSINESS_LICENCE_CERT("BUSINESS_LICENCE_CERT", "营业执照或社会信用代码证书"),
    //新增执行完成相关附件
    PAYMENT_PROOF("PAYMENT_PROOF", "缴款凭证"),
    REAL_PLACE_CHECK_RECORD("REAL_PLACE_CHECK_RECORD", "现场核查记录"),
    //新增简易处罚取证照片
    EVIDENCE_PHOTO("EVIDENCE_PHOTO", "取证照片"),
    //新增处罚决定撤销相关附件
    PUNISH_DECISION_REVOKE("PUNISH_DECISION_REVOKE", "处罚决定撤销附件"),
    ATTACHTYPE1("ATTACHTYPE1", "案件来源登记表"),
    ATTACHTYPE2("ATTACHTYPE2", "立案审批表"),
    ATTACHTYPE3("ATTACHTYPE3", "询问通知书"),
    ATTACHTYPE4("ATTACHTYPE4", "现场勘验（检查）笔录"),
    ATTACHTYPE5("ATTACHTYPE5", "现场勘验图"),
    ATTACHTYPE6("ATTACHTYPE6", "现场照片及说明"),
    ATTACHTYPE7("ATTACHTYPE7", "询问笔录"),
    ATTACHTYPE8("ATTACHTYPE8", "当事人身份证件"),
    ATTACHTYPE9("ATTACHTYPE9", "法定代表人（负责人）身份证明书"),
    ATTACHTYPE10("ATTACHTYPE10", "授权委托书"),
    ATTACHTYPE11("ATTACHTYPE11", "调取证据材料通知书"),
    ATTACHTYPE12("ATTACHTYPE12", "抽样取证通知书"),
    ATTACHTYPE13("ATTACHTYPE13", "鉴定（检测、检验、检疫）委托书"),
    ATTACHTYPE14("ATTACHTYPE14", "鉴定（检测、检验、检疫）意见告知书"),
    ATTACHTYPE15("ATTACHTYPE15", "先行登记保存证据通知书"),
    ATTACHTYPE16("ATTACHTYPE16", "解除先行登记保存证据通知书"),
    ATTACHTYPE17("ATTACHTYPE17", "查封（扣押）决定书"),
    ATTACHTYPE18("ATTACHTYPE18", "延长查封（扣押）期限决定书"),
    ATTACHTYPE19("ATTACHTYPE19", "解除查封（扣押）决定书"),
    ATTACHTYPE20("ATTACHTYPE20", "行政强制措施物品移送告知书"),
    ATTACHTYPE21("ATTACHTYPE21", "行政强制措施现场笔录"),
    ATTACHTYPE22("ATTACHTYPE22", "责令改正通知书"),
    ATTACHTYPE23("ATTACHTYPE23", "责令改正情况复查记录"),
    ATTACHTYPE24("ATTACHTYPE24", "责令停止违法行为通知书"),
    ATTACHTYPE25("ATTACHTYPE25", "送达方式及地址确认书"),
    ATTACHTYPE26("ATTACHTYPE26", "征询意见函"),
    ATTACHTYPE27("ATTACHTYPE27", "案件移送函"),
    ATTACHTYPE28("ATTACHTYPE28", "涉嫌犯罪案件移送书"),
    ATTACHTYPE29("ATTACHTYPE29", "案件合议记录"),
    ATTACHTYPE30("ATTACHTYPE30", "案件调查终结报告"),
    ATTACHTYPE31("ATTACHTYPE31", "撤销立案审批表"),
    ATTACHTYPE32("ATTACHTYPE32", "行政处罚告知审批表"),
    ATTACHTYPE33("ATTACHTYPE33", "重大案件集体讨论记录"),
    ATTACHTYPE34("ATTACHTYPE34", "行政处罚告知书"),
    ATTACHTYPE35("ATTACHTYPE35", "行政处罚（听证类）告知书"),
    ATTACHTYPE36("ATTACHTYPE36", "不予行政处罚告知书"),
    ATTACHTYPE37("ATTACHTYPE37", "陈述申辩笔录"),
    ATTACHTYPE38("ATTACHTYPE38", "听证通知书"),
    ATTACHTYPE39("ATTACHTYPE39", "不予受理听证通知书"),
    ATTACHTYPE40("ATTACHTYPE40", "听证笔录"),
    ATTACHTYPE41("ATTACHTYPE41", "听证报告"),
    ATTACHTYPE42("ATTACHTYPE42", "行政处罚决定审批表"),
    ATTACHTYPE43("ATTACHTYPE43", "行政处罚决定书"),
    ATTACHTYPE44("ATTACHTYPE44", "撤销行政处罚决定审批表"),
    ATTACHTYPE45("ATTACHTYPE45", "不予行政处罚决定书"),
    ATTACHTYPE46("ATTACHTYPE46", "当场处罚决定书"),
    ATTACHTYPE47("ATTACHTYPE47", "同意分期（延期）缴纳罚款通知书"),
    ATTACHTYPE48("ATTACHTYPE48", "不同意分期（延期）缴纳罚款通知书"),
    ATTACHTYPE49("ATTACHTYPE49", "行政决定履行催告书"),
    ATTACHTYPE50("ATTACHTYPE50", "加处罚款决定书"),
    ATTACHTYPE51("ATTACHTYPE51", "强制执行申请书"),
    ATTACHTYPE52("ATTACHTYPE52", "限期拆除公告"),
    ATTACHTYPE53("ATTACHTYPE53", "强制拆除决定书"),
    ATTACHTYPE54("ATTACHTYPE54", "代履行决定书"),
    ATTACHTYPE55("ATTACHTYPE55", "代履行催告书"),
    ATTACHTYPE56("ATTACHTYPE56", "立即代履行决定书"),
    ATTACHTYPE57("ATTACHTYPE57", "代履行完毕确认书"),
    ATTACHTYPE58("ATTACHTYPE58", "中止强制执行通知书"),
    ATTACHTYPE59("ATTACHTYPE59", "执行协议"),
    ATTACHTYPE60("ATTACHTYPE60", "恢复强制执行通知书"),
    ATTACHTYPE61("ATTACHTYPE61", "终结强制执行通知书"),
    ATTACHTYPE62("ATTACHTYPE62", "行政强制执行现场笔录"),
    ATTACHTYPE63("ATTACHTYPE63", "执行情况核查"),
    ATTACHTYPE64("ATTACHTYPE64", "案件结案报告"),
    ATTACHTYPE65("ATTACHTYPE65", "内部审批表"),
    ATTACHTYPE66("ATTACHTYPE66", "回避决定书"),
    ATTACHTYPE67("ATTACHTYPE67", "物品处理记录"),
    ATTACHTYPE68("ATTACHTYPE68", "放弃陈述、申辩声明"),
    ATTACHTYPE69("ATTACHTYPE69", "案件中止审批表"),
    ATTACHTYPE70("ATTACHTYPE70", "案件终止审批表"),
    ATTACHTYPE71("ATTACHTYPE71", "案件延期审批表"),
    ATTACHTYPE72("ATTACHTYPE72", "其他"),
    ATTACHTYPE73("ATTACHTYPE73", "当事人信息调整附件"),
    ATTACHTYPE74("ATTACHTYPE74", "自然资源地图坐标信息"),
    ATTACHTYPE90("ATTACHTYPE90", "勘验笔录"),
    ATTACHTYPE91("ATTACHTYPE91", "现场照片"),
    ATTACHTYPE92("ATTACHTYPE92", "身份证明"),
    ATTACHTYPE93("ATTACHTYPE93", "现场示意图"),
    SIGN_ATTACHMENT_01("SIGN_ATTACHMENT_01", "签字捺印签字轨迹附件"),
    SIGN_ATTACHMENT_02("SIGN_ATTACHMENT_02", "签字捺印视频附件"),
    SIMPLE_CASE_ATTACHMENT_01("SIMPLE_CASE_ATTACHMENT_01", "执行情况附件")
    ;


    /**
     * 编码
     */
    @Getter
    private String code;
    /**
     * 描述
     */
    @Getter
    private String des;

    /**
     * 描述：根据code获取value
     *
     * @param code 编码
     * @return 描述内容
     * @author xiangyuyu
     * @date 2022-02-22 10:43
     */
    public static String getValueByCode(String code) {
        if (ObjectUtils.isEmpty(code)) {
            return null;
        }
        for (AttachmentTypeEnum e : AttachmentTypeEnum.values()) {
            if (code.equals(e.getCode())) {
                return e.getDes();
            }
        }
        return null;
    }

    /**
     * 描述：校验code是否是合法枚举
     *
     * @param code 枚举code
     * @return boolean 是否合法枚举（true-是/false-否）
     * @author xiangyuyu
     * @date 2022-02-22 10:42
     */
    public static boolean isLegalEnumCode(String code) {
        boolean flag = false;
        for (AttachmentTypeEnum e : AttachmentTypeEnum.values()) {
            if (e.getCode().equalsIgnoreCase(code)) {
                flag = true;
                break;
            }
        }
        return flag;
    }
}
